using System;

namespace CSharp_1209
{
    class Books
    {
        public static void Test()
        {
            // Array of string to store column names
            string[] colName = new string[4] { "Book Title", "Author", "Publisher", "Price($)" };

            // Two dimensional array of string type to store book details
            string[,] bookDetails = new string[2, 4];

            Console.WriteLine("Length of ColName {0}", colName.Length);
            Console.WriteLine("Length of BookDetails {0}", bookDetails.Length);

            // Accepting and storing the details of books
            Console.WriteLine("Enter book details :\n");
            
            for (int i = 0; i < bookDetails.GetLength(0); i++)
            {
                for (int j = 0; j < bookDetails.GetLength(1); j++)
                {
                    Console.Write("{0} : ", colName[j]);
                    bookDetails[i, j] = Console.ReadLine();
                }
                Console.WriteLine();
            }

            // Displaying the column names
            Console.WriteLine("Details of books : \n");
            foreach (string names in colName)
            {
                Console.Write("{0}\t\t", names);
            }
            Console.WriteLine();
            // Displaying the details of books 
            for (int i = 0; i < bookDetails.GetLength(0); i++)
            {
                for (int j = 0; j < 4; j++)
                {
                    Console.Write(bookDetails[i, j] + "\t\t");
                }
                Console.WriteLine();
            }
        }
    }
}
